import req from '@/http/http'
import {getServer} from '@/http/AppApi'

let ZHPQ_SERVER = getServer()

// 矛盾调解
// 查询当前用户待办任务
export const getBacklogTasks = data => {
  let path = ZHPQ_SERVER + '/contradictoryAdjustment/tasks/runtime/'
  return req.get(path, data)
}
// 查询当前用户办理过的任务列表
export const getHistoricTasks = data => {
  let path = ZHPQ_SERVER + '/contradictoryAdjustment/tasks/historic/'
  return req.get(path, data)
}
// 完成任务请求 id系任务Id
export const finishTasks = data => {
  let path = ZHPQ_SERVER + '/contradictoryAdjustment/task/runtime/' + data.taskId
  return req.put(path, data)
}
// 新增
export const createContradictoryAdjustment = data => {
  let path = ZHPQ_SERVER + '/contradictoryAdjustment/'
  return req.post(path, data)
}
// 更新
export const updateContradictoryAdjustment = data => {
  let path = ZHPQ_SERVER + '/contradictoryAdjustment/' + data.id
  return req.put(path, data)
}
// 通过id获取单条数据
export const getContradictoryAdjustmentList = id => {
  let path = ZHPQ_SERVER + '/contradictoryAdjustment/' + id
  return req.get(path)
}
// 查看流程监控
export const getContradictoryAdjustmentPhoto = id => {
  let path = ZHPQ_SERVER + '/contradictoryAdjustment/trace/photo/' + id
  return path
}
// 查看流程时间轴
export const getContradictoryAdjustmentTimer = id => {
  let path = ZHPQ_SERVER + '/contradictoryAdjustment/trace/' + id
  return req.get(path)
}

// 查询所有未完结和已完结事件 parm 1:已完结，0：未完结
export const getResolveStatus = parm => {
  let path = ZHPQ_SERVER + '/contradictoryAdjustment/resolveStatus/' + parm.id
  return req.get(path, parm)
}

// 设置逾期
export const setOverdue = param => {
  let path = ZHPQ_SERVER + '/contradictoryAdjustment/' + param.id
  return req.put(path, param)
}

// 设置重要事件
export const setImportantEvent = param => {
  let path = ZHPQ_SERVER + '/contradictoryAdjustment/' + param.id
  return req.put(path, param)
}

// 导出
export const getExportFileUrl = data => {
  let path = ZHPQ_SERVER + '/contradictoryAdjustment/export/excel'
  return path
}
